/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package edu.asu.cse360.client.util;

import edu.asu.cse360.client.ui.frame.AppFrame;
import edu.asu.cse360.client.ui.frame.MenuEditPanel;
import edu.asu.cse360.client.ui.frame.OrderStatusPanel;
import edu.asu.cse360.client.ui.frame.TableEditPanel;
import java.awt.BorderLayout;
import java.awt.CardLayout;
import java.util.ArrayList;
import java.util.List;
import javax.swing.JMenu;

/**
 *This class configures the frame for the Waitperson
 * @author Steven
 */
public class WaitPersonConfiguration extends AppConfiguration {

    private WaitPersonConfiguration(){}
    private static WaitPersonConfiguration instance;
    public static WaitPersonConfiguration instance(){
        if(instance == null){
            instance = new WaitPersonConfiguration();
        }
        return instance;
    }


    @Override
    public void configure(AppFrame frame) {
        frame.showCard("waitPersonCard");
        addMenuBar(frame);
        if(!hasConfiguredAppFrame){
            addPanels(frame);
            hasConfiguredAppFrame = true;
        }
    }
    private void addPanels(AppFrame frame) {
        frame.getWaitPersonOrdersContainer().setLayout(new BorderLayout());
        frame.getWaitPersonOrdersContainer().add(new OrderStatusPanel(), BorderLayout.CENTER);
        frame.getMenuEditContainer().revalidate();
        frame.getTableStatusContainer().setLayout(new BorderLayout());
        frame.getTableStatusContainer().add(new TableEditPanel(), BorderLayout.CENTER);
        frame.getMenuEditContainer().revalidate();
    }


    protected List<JMenu> getMenus(AppFrame frame){
        List<JMenu> menus = new ArrayList<JMenu>();
        //menus.add(getSettingsMenu());
        menus.add(getHelpMenu());
        menus.add(getAdminMenu(frame));
        return menus;
    }
}
